<table width="100%" height="350px">
  <% if @contents.length >0 %>
      <th>S.No.</th>
      <th>Questions</th>
      <th>Posted On</th>
      <th>Author</th>
      <th>Replies</th>
  <%else%>
      <tr><td valign="center" align="center">No Questions/Answers posted yet!</td><tr>
  <%end%>

  <% if params[:page] %>
      <% @iID = ((params[:page].to_i - 1) * @items_per_page)  %>
  <% else %>
      <% @iID = 0 %>
  <% end %>
  <% for @content in @contents%>
      <% content_tag_for(:tr, @content) do %>
          <% @iID = @iID + 1 %>
          <td align="center"><%=h @iID %></td>
          <td><%=h link_to @content.title,:controller => :content, :action => :showQuestion, :question_id => @content.article_id %></td>
          <td align="center"><%=h @content.publishdate.to_datetime.strftime('%Y-%m-%d %H:%M:%S') %></td>
          <td align="center"><%=h link_to @content.author, :controller => :profile, :id => @content.user_id %></td>          
          <td align="center"><%=h @content.total_reply %></td>
      <% end %>
  <% end %>
</table>
